﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using GatherWebLib.Model;
using System.Data;
using GatherWebLib.DAL;

namespace GatherWebLib
{
   public class cTask
    {
       
        /// <summary>
     /// 获取指定的任务
     /// </summary>
     /// <param name="taskID"></param>
     /// <returns></returns>
       public List<cTask_m> GetTasks(int taskCalssID)
       { 
         T_002Task_DAL dal=new T_002Task_DAL();

         return dal.GetTasks(taskCalssID);
       }

     /// <summary>
     /// 获取指定的任务
     /// </summary>
     /// <param name="taskID"></param>
     /// <returns></returns>
       public cTask_m GetTaskInfo(int taskID)
       {
           cTask_m task = new cTask_m();
           //根据一个任务名称装载一个任务
           try
           {
               T_002Task_DAL dal=new T_002Task_DAL();

               task = dal.GetTask(taskID);
           }
           catch (System.Exception ex)
           {
               
           }
          return task;
       }

       /// <summary>
       /// 获取指定的任务
       /// </summary>
       /// <param name="taskID"></param>
       /// <returns></returns>
       public cPublishTask_m GetPublishTaskInfo(int taskID)
       {
           cPublishTask_m task = new cPublishTask_m();
           //根据一个任务名称装载一个任务
           try
           {
               T_006PublishTask_DAL dal = new T_006PublishTask_DAL();

               task = dal.GetObjectByTaskID(taskID);
           }
           catch (System.Exception ex)
           {

           }
           return task;
       }
       public List<cTask_m> GetTasksByLevel(int level)
       {
           List<cTask_m> tasks = new List<cTask_m>();
           //根据一个任务名称装载一个任务
           try
           {
               T_002Task_DAL dal = new T_002Task_DAL();

               tasks = dal.GetTasksByLevel(level);
           }
           catch (System.Exception ex)
           {

           }
           return tasks;
       }
    }
}
